import React, { Component } from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';

export default class Floor extends Component {
  render() {
    const { title, floors = [] } = this.props;
    return (
      <View>
        <Text style={styles.titleStyle}>{title}</Text>
        <View style={styles.floorsStyle}>
          {
            floors.map(floor => {
              return (
                <Image
                key={floor.goodsId}
                style={styles.floorImg}
                source={{ uri: floor.image }}
                resizeMode="stretch"
              />
              )
            })
          }
        </View>
      </View>
    )
  }
}
const styles = StyleSheet.create({
  titleStyle: {
    width: '100%',
    lineHeight: 50,
    backgroundColor: '#fff',
    paddingLeft: 10,
  },
  floorsStyle: {
    borderTopWidth: 1,
    borderTopColor: '#e8e8e8',
    flexDirection: 'row',
    flexWrap: 'wrap'
  },
  floorImg: {
    width: '50%',
    height: 100,
  },
})